
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.entity.Working"%>
<%@page import="java.util.List"%>
<%@ page import="com.util.MybatisUtil" %>
<%@ page import="com.dao.WorkingMapper" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="org.apache.ibatis.session.SqlSession" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>工作笔记</title>
</head>

<c:if test="${list==null || list==''}">
  <c:redirect url="Per?pre=list"></c:redirect>
</c:if>

<body>
<h1 style="text-align: center;">工作笔记</h1>
<a href="add.jsp" style="margin-left: 52%;">添加笔记</a>
<table border="2" cellpadding="5" align="center" id="tab">
  <tr style="background-color:aqua;">
    <td>笔记标题</td>
    <td>笔记分类</td>
    <td>编写时间</td>
    <td>操作</td>
  </tr>
  <c:forEach var="entry" items="${list}" varStatus="status">
    <tr <c:if test="${status.index%2==1}"> style="background-color:aqua;" </c:if>>
      <td>${entry.title}</td>
      <td>${entry.type}</td>
      <td>${entry.createDate}</td>
      <td><a href="Per?pre=get&id=${entry.id}">查看</a>
        <a href="Per?pre=del&id=${entry.id}" onclick="return confirm('确定要删除吗？');">删除</a>
        <a href="update.jsp?id=${entry.id}">修改</a>
      </td>
    </tr>
  </c:forEach>
</table>
</body>
</html>
